package com.jiangtour.dataobject;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.jiangtour.enums.UseStatusEnum;
import com.jiangtour.utils.EnumUtil;
import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Id;
import java.math.BigDecimal;

/**
 * @author Administrator
 * @Title: SiteInfo
 * @ProjectName site
 * @Description:
 * @date 2018/12/25/02515:25
 */

@Entity
@DynamicUpdate
@Data
public class SiteInfo {
//     `id` int not null auto_increment,
//            `site_name` varchar(64) not null comment '学校名称',
//            `account` varchar(128) NOT NULL COMMENT '登录账号',
//            `password` varchar(128) DEFAULT NULL COMMENT '密码',
//            `salt` varchar(64) DEFAULT NULL COMMENT '加盐',
//            `service_amount` decimal(8,2) NOT NULL COMMENT '寄件上门费用',
//            `use_status` tinyint(3) NOT NULL DEFAULT '0' COMMENT '使用状态, 默认使用',
//            `tel` varchar(255) DEFAULT NULL COMMENT '联系电话',
//            `pro_id` varchar(16) DEFAULT NULL COMMENT '省编号',
//            `pro_name` varchar(128) DEFAULT NULL COMMENT '省名',
//            `city_id` varchar(16) DEFAULT NULL COMMENT '城市编号',
//            `city_name` varchar(255) DEFAULT NULL COMMENT '城市名称',
//            `county_id` varchar(16) DEFAULT NULL COMMENT '区县编号',
//            `county_name` varchar(255) DEFAULT NULL COMMENT '区县编号',
//            `address` varchar(255) DEFAULT NULL COMMENT '详细地址',
//            `full_address` varchar(1024) DEFAULT NULL COMMENT '完整地址',
//            `lng` decimal(12,6) DEFAULT NULL COMMENT '经度',
//            `lat` decimal(12,6) DEFAULT NULL COMMENT '纬度',
        @Id
        private String id;

        private  String siteName;

        private  String account;

        private  String password;

        private  String salt;

        private  BigDecimal serviceAmount;

        private Integer  useStatus=UseStatusEnum.USE.getCode();

        private String tel;

        private String   proId;

        private  String proName;

        private  String cityId;

        private  String cityName;

        private  String countyId;

        private  String countyName;

        private  String address;

        private String fullAddress;

        private  BigDecimal lng;

        private  BigDecimal lat;

        @JsonIgnore
        public UseStatusEnum getUseStatusEnum() {
                return EnumUtil.getByCode(useStatus, UseStatusEnum.class);
        }


}
